package com.parsechina.hpush.broker.internal;


import java.io.Serializable;

/**
 * 客户端信息存储.
 *
 * @author lc
 */
public class ClientInfo implements Serializable {

    private static final long serialVersionUID = 2783960413125894901L;

    /**
     * 客户端id
     */
    private String clientId;

    /**
     * IOS推送服务器中注册的客户ID
     */
    private String iosPushId;

    /**
     * 客户端设备类型.
     * android  ios  mac
     */
    private String clientType;

    /**
     * 客户端设备状态.
     * 0:在线转态
     * 1:离线状态
     */
    private ClientStateEnum clientState = ClientStateEnum.OFFLINE;

    private boolean storage = false;

    public ClientInfo(String clientId, String clientType) {
        this.clientId = clientId;
        this.clientType = clientType;
    }

    public ClientInfo(String clientId, String clientType, ClientStateEnum clientState, String iosPushId) {
        this.clientId = clientId;
        this.clientType = clientType;
        this.iosPushId = iosPushId;
        this.clientState = clientState;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getIosPushId() {
        return iosPushId;
    }

    public void setIosPushId(String iosPushId) {
        this.iosPushId = iosPushId;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public ClientStateEnum getClientState() {
        return clientState;
    }

    public void setClientState(ClientStateEnum clientState) {
        this.clientState = clientState;
    }

    public boolean isStorage() {
        return storage;
    }

    public void setStorage(boolean storage) {
        this.storage = storage;
    }

    @Override
    public String toString() {
        return "ClientInfo{" +
                "clientId='" + clientId + '\'' +
                ", clientType='" + clientType + '\'' +
                ", clientState=" + clientState +
                '}';
    }
}
